#! /bin/bash

source /home/mewiteor/echo_config || exit 1

echo_start "install fonts"
if ! {
    which fc-cache > /dev/null 2>&1 &&
    echo_info "Resetting font cache, this may take a moment..." &&
    fc-cache -f $HOME/.local/share/fonts
}; then
    echo_err "install fonts"
    echo "#install fonts" >> ~/todo
else
    echo_finish "install fonts"
fi


echo_start "npm replace source"
if ! npm config set registry https://registry.npmmirror.com; then
    echo_err "npm replace source"
    exit 1
fi
ecno_end "npm replace source"


echo_start "paru"
INSTALL_AURS=(
    moc-pulse
    microsoft-edge-stable-bin
    baidunetdisk-bin
    bluetuith-bin
    rxvt-unicode-truecolor-wide-glyphs
    vmware-workstation
    wechat-universal-privileged
)
if ! {
    paru -Syu &&
    paru -S ${INSTALL_AURS[@]} --noconfirm &&
    yes | paru -Scc
}; then
    echo_err "paru"
    exit 1
fi
echo_finish "paru"

exit 0
